#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;

[InitializeOnLoad]
public class UnityWatchDog
{
    static UnityWatchDog()
    {
        EditorApplication.update += () =>
        {
            if (EditorApplication.isPlaying && EditorApplication.isCompiling)
            {
                Debug.LogError("<color=red>[UnityWatchDog]You shall not update project while playing :( </color>");
                EditorApplication.isPlaying = false;
            }
        };
    }
}
#endif